<html lang="en">
<head>
    <title>攻略推荐管理</title>
    <#include "../common/header.ftl">

    <link type="text/css" rel="stylesheet" href="/js/plugins/uploadifive/uploadifive.css" />
    <script type="text/javascript" src="/js/plugins/uploadifive/jquery.uploadifive.min.js"></script>

    <script type="text/javascript">
        $(function () {
            $(".lookBtn").click(function () {
                var id = $(this).data('id');
                //根据id查询游记内容
                $.get('/travelComment/getContentById',{id:id},function (data) {
                    console.log(data);
                    $("#inputModal .modal-body").html(data.data);
                    $("#inputModal").modal('show');
                })
            })
        })
    </script>
</head>
<body>
<!--左侧菜单回显变量设置-->
<#assign currentMenu="travelComment">

<div class="container-fluid " style="margin-top: 20px">
    <#include "../common/top.ftl">
    <div class="row">
        <div class="col-sm-2">
            <#include "../common/menu.ftl">
        </div>
        <div class="col-sm-10">
            <div class="row">
                <div class="col-sm-12">
                    <h1 class="page-head-line">攻略推荐管理</h1>
                </div>
            </div>
            <#setting number_format="#">
            <!--高级查询--->
            <form class="form-inline" id="searchForm" action="/travelComment/list" method="post">
                <input type="hidden" name="currentPage" id="currentPage" value="1">
            </form>

            <table class="table table-striped table-hover" >
                <thead>
                    <tr>
                        <th>序号</th>
                        <th>用户头像</th>
                        <th>发布人</th>
                        <th>所在游记</th>
                        <th>所在城市</th>
                        <th>发布时间</th>
                        <th>发布内容</th>
                        <th>操作</th>
                    </tr>
                </thead>
               <#list page.content as entity>
                   <tr>
                       <td>${entity_index+1}</td>
                       <td><img src="${entity.headImgUrl!}" width="50px"></td>
                       <td>${entity.nickname!}</td>
                       <td>${entity.travelTitle!}</td>
                       <td>${entity.city!}</td>
                       <td>${entity.createTime?string('yyyy:dd:MM')!}</td>
                       <td>${entity.content!}</td>
                       <td>
                           <a class="btn btn-info btn-xs lookBtn" href="JavaScript:;" data-id="${entity.id}">
                               <span class="glyphicon glyphicon-th"></span> 查看评论</a>

                       </td>
                   </tr>
               </#list>
            </table>
            <#--分页-->
            <#include "../common/page.ftl"/>
        </div>
    </div>
</div>
<!-- 模态框必须作为body的子标签 -->
<div class="modal fade" id="inputModal" tabindex="-1" role="dialog"
     aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                <h4 class="modal-title" id="myModalLabel">查看文章内容</h4>
            </div>
            <div class="modal-body" >

            </div>
        </div>
    </div>
</div>
<script>
    $("table img").click(function(){
        var src = $(this).attr("src");
        $("#ShowImage_Form .modal-body").html("<img src='"+src+"' class='carousel-inner img-responsive img-rounded' />");
        $("#ShowImage_Form").modal('show');
    })
</script>
</body>
</html>